<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html>
  <base href="${APP_PATH}/">
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>班主任考试表</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="public/css/bootstrap.min.css" rel="stylesheet">
<link href="public/css/materialdesignicons.min.css" rel="stylesheet">
<link href="public/css/style.min.css" rel="stylesheet">
</head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
     <jsp:include page="/menu.jsp"></jsp:include>
    <!--End 左侧导航-->
    
    <!--头部信息-->
     <jsp:include page="/head.jsp"></jsp:include>
    <!--End 头部信息-->
    
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid">
        
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-toolbar clearfix">
                <form class="pull-right search-bar" method="get" action="#!" role="form">
                  <div class="input-group">
                    <div class="input-group-btn">
                      <input type="hidden" name="search_field" id="search-field" value="title">
                      <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                      标题 <span class="caret"></span>
                      </button>
                      <ul class="dropdown-menu">
                        <li> <a tabindex="-1" href="javascript:void(0)" data-field="title">标题</a> </li>
                        <li> <a tabindex="-1" href="javascript:void(0)" data-field="cat_name">栏目</a> </li>
                      </ul>
                    </div>
                    <input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
                  </div>
                </form>
                <div class="toolbar-btn-action">
                  <a class="btn btn-primary m-r-5" href="#!"><i class="mdi mdi-plus"></i> 新增</a>
                  <a class="btn btn-success m-r-5" href="#!"><i class="mdi mdi-check"></i> 启用</a>
                  <a class="btn btn-warning m-r-5" href="#!"><i class="mdi mdi-block-helper"></i> 禁用</a>
                  <a class="btn btn-danger" href="#!"><i class="mdi mdi-window-close"></i> 删除</a>
                </div>
              </div>
              <div class="card-body">
                
                <div class="table-responsive">
                  <table class="table table-bordered">
                    <thead>
                      <tr>
                        <th>
                          <label class="lyear-checkbox checkbox-primary">
                            <input type="checkbox" id="check-all"><span></span>
                          </label>
                        </th>
                        <th>编号</th>
                        <th>考试名</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>班级名</th>
                        <th>考试教室</th>
                        
                        <th>操作</th>
                       
                      </tr>
                    </thead>
                    <tbody id="tbody">

                      
                    </tbody>
                  </table>
                </div>
                <ul class="pagination">
                  <li class="disabled"><span>«</span></li>
                  <li class="active"><span>1</span></li>
                  <li><a href="#1">2</a></li>
                  <li><a href="#1">3</a></li>
                  <li><a href="#1">4</a></li>
                  <li><a href="#1">5</a></li>
 
                  <li class="disabled"><span>...</span></li>
                  <li><a href="#!">8</a></li>
               
                  <li><a href="#!">»</a></li>
                </ul>
       
              </div>
            </div>
          </div>
          
        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script type="text/javascript" src="public/js/bootstrap.min.js"></script>
<script type="text/javascript" src="public/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="public/js/main.min.js"></script>
<script type="text/javascript">
$(function(){
    
    
   
    $.ajax({
		url:"${APP_PATH}/exam/classmanager/indexDo",
		type:"post",
		success:function(data){
			
			show(data)
			
		}
	})
  
});


function show(data){

	var content="";
	var count=1;
	$.each(data.examList,function(index,obj){
		content+="<tr><th><label class='lyear-checkbox checkbox-primary'><input type='checkbox' name='sid' value="+obj.sid+"><span></span></label></th>"
		content+="<th>"+ count++ +"</th>";
		content+="<th>"+obj.name+"</th>";
		content+="<th>"+obj.starttime+"</th>";
		content+="<th>"+obj.endtime+"</th>";
		
		$.each(data.classList,function(index,obj2){
			if(obj.classid==obj2.cid){
			content+="<th>"+obj2.cname+"</th>"
			}
			})
		$.each(data.roomList,function(index,obj3){
			if(obj.roomid==obj3.rid){
			content+="<th>"+obj3.rname+"</th>"
			}
			})
	
	
		
// 		content+=" <th><div class='btn-group'>"
// 		content+="<a class='btn btn-s btn-default' href='#!' title='编辑' data-toggle='tooltip'><i class='mdi mdi-pencil'></i></a>"
// 		content+="<a class='btn btn-s btn-default' href='#!' title='删除' data-toggle='tooltip'><i class='mdi mdi-window-close'></i></a></div></th></tr>"
		
        
		
	})
	$("#tbody").html(content);	
}



</script>
</body>
</html>